package com.ruoyi.generator.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.generator.mapper.GeneratedLogMapper;
import com.ruoyi.generator.domain.GeneratedLog;
import com.ruoyi.generator.service.IGeneratedLogService;

/**
 * 代码生产日志Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-26
 */
@Service
public class GeneratedLogServiceImpl implements IGeneratedLogService 
{
    @Autowired
    private GeneratedLogMapper generatedLogMapper;

    /**
     * 查询代码生产日志
     * 
     * @param id 代码生产日志主键
     * @return 代码生产日志
     */
    @Override
    public GeneratedLog selectGeneratedLogById(Long id)
    {
        return generatedLogMapper.selectGeneratedLogById(id);
    }

    /**
     * 查询代码生产日志列表
     * 
     * @param generatedLog 代码生产日志
     * @return 代码生产日志
     */
    @Override
    public List<GeneratedLog> selectGeneratedLogList(GeneratedLog generatedLog)
    {
        return generatedLogMapper.selectGeneratedLogList(generatedLog);
    }

    /**
     * 新增代码生产日志
     * 
     * @param generatedLog 代码生产日志
     * @return 结果
     */
    @Override
    public int insertGeneratedLog(GeneratedLog generatedLog)
    {
        generatedLog.setCreateTime(DateUtils.getNowDate());
        return generatedLogMapper.insertGeneratedLog(generatedLog);
    }

    /**
     * 修改代码生产日志
     * 
     * @param generatedLog 代码生产日志
     * @return 结果
     */
    @Override
    public int updateGeneratedLog(GeneratedLog generatedLog)
    {
        generatedLog.setUpdateTime(DateUtils.getNowDate());
        return generatedLogMapper.updateGeneratedLog(generatedLog);
    }

    /**
     * 批量删除代码生产日志
     * 
     * @param ids 需要删除的代码生产日志主键
     * @return 结果
     */
    @Override
    public int deleteGeneratedLogByIds(Long[] ids)
    {
        return generatedLogMapper.deleteGeneratedLogByIds(ids);
    }

    /**
     * 删除代码生产日志信息
     * 
     * @param id 代码生产日志主键
     * @return 结果
     */
    @Override
    public int deleteGeneratedLogById(Long id)
    {
        return generatedLogMapper.deleteGeneratedLogById(id);
    }
}
